package com.xiyu.service.model.customer.info;

import com.xiyu.service.model.base.BaseEntity;
import com.xiyu.service.model.system.user.SystemUser;
import com.xiyu.service.model.infra.data.DictCountry;
import com.xiyu.service.model.infra.data.DictProvince;
import com.xiyu.service.model.infra.data.DictCity;
import com.xiyu.service.model.infra.data.DictDistrict;
import com.xiyu.service.model.system.dept.SystemDept;
import com.xiyu.service.model.customer.contact.CustomerContact;
import org.babyfish.jimmer.sql.*;
import java.time.LocalDateTime;
import org.jetbrains.annotations.Nullable;
import java.util.List;

@Entity
public interface CustomerInfo extends BaseEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    long id();

    String customerNo();

    String name();

    String mainImageUrl();

    Long source();

    Long grade();

    Long stage();

    Long state();

    @IdView
    @Nullable
    Long ownerId();

    @OneToOne
    @Nullable
    @OnDissociate(DissociateAction.DELETE)
    SystemUser owner();

    @IdView
    @Nullable
    Long countryId();

    @OneToOne
    @Nullable
    @OnDissociate(DissociateAction.DELETE)
    DictCountry country();

    @IdView
    @Nullable
    Long provinceId();

    @OneToOne
    @Nullable
    @OnDissociate(DissociateAction.DELETE)
    DictProvince province();

    @IdView
    @Nullable
    Long cityId();

    @OneToOne
    @Nullable
    @OnDissociate(DissociateAction.DELETE)
    DictCity city();

    @IdView
    @Nullable
    Long districtId();

    @OneToOne
    @Nullable
    @OnDissociate(DissociateAction.DELETE)
    DictDistrict district();

    String address();

    @IdView
    @Nullable
    Long deptId();

    @OneToOne
    @Nullable
    @OnDissociate(DissociateAction.DELETE)
    SystemDept dept();

    String customField1();

    String customField2();

    String customField3();

    String customField4();

    String customField5();

    String customField6();

    String customField7();

    String customField8();

    String customField9();

    String customField10();

    String customField11();

    String customField12();

    String customField13();

    String customField14();

    String customField15();

    String customField16();

    String customField17();

    String customField18();

    String customField19();

    String customField20();

    @IdView
    @Nullable
    Long mainContactId();

    @OneToOne
    @Nullable
    @OnDissociate(DissociateAction.DELETE)
    CustomerContact mainContact();

    Boolean isRecycle();

    Boolean isFallPool();

    @Nullable
    LocalDateTime fallPoolTime();

    @Nullable
    LocalDateTime lastFollowTime();

    @Nullable
    LocalDateTime lastSendMailTime();

    String fallPoolReason();

    @Nullable
    LocalDateTime comingFallPoolTime();

    Long comingFallPoolRuleId();

    String shortName();

    @Nullable
    @LogicalDeleted("now")
    LocalDateTime deletedTime();

    @OneToMany(mappedBy = "customer")
    List<CustomerContact> contacts();

    @OneToMany(mappedBy = "customer")
    List<CustomerImage> images();

    @OneToMany(mappedBy = "customer")
    List<CustomerWebsite> websites();

}